const express = require('express')
const WebpackDevMiddleware = require('webpack-dev-middleware')
const webpack = require('webpack')
const app = express()

// 获取配置文件
const config = require('./lg.webpack.js')
const compiler = webpack(config)

app.use(WebpackDevMiddleware(compiler))

// 开启端口上的服务
app.listen(3000, () => {
  console.log('服务运行在3000端口上！')
})